package item;

import com.item.manager.Template;

public class Item {
    private final Template template;

    public Item(Template template) {
        this.template = template;
    }

    public String getName() {
        return template.name();
    }

    @Override
    public String toString() {
        return template.name();
    }

    public int getCost() {
        return 100;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Item other = (Item) obj;
        if (getName() == null) {
            if (other.getName() != null)
                return false;
        } else if (!getName().equals(other.getName()))
            return false;
        return true;
    }
}
